<div class="purchases index">
	<h2><?php echo __('Purchases'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('id'); ?></th>
			<th><?php echo $this->Paginator->sort('purchase_price1'); ?></th>
			<th><?php echo $this->Paginator->sort('purchase_price2'); ?></th>
			<th><?php echo $this->Paginator->sort('freight1'); ?></th>
			<th><?php echo $this->Paginator->sort('freight2'); ?></th>
			<th><?php echo $this->Paginator->sort('buying'); ?></th>
			<th><?php echo $this->Paginator->sort('ducamz_value'); ?></th>
			<th><?php echo $this->Paginator->sort('vendor_name'); ?></th>
			<th><?php echo $this->Paginator->sort('purchase_ref_no'); ?></th>
			<th><?php echo $this->Paginator->sort('purchase_by'); ?></th>
			<th><?php echo $this->Paginator->sort('pur_date'); ?></th>
			<th><?php echo $this->Paginator->sort('ship_date'); ?></th>
			<th><?php echo $this->Paginator->sort('ship_name'); ?></th>
			<th><?php echo $this->Paginator->sort('bl_no'); ?></th>
			<th><?php echo $this->Paginator->sort('cont_no'); ?></th>
			<th><?php echo $this->Paginator->sort('bol_1'); ?></th>
			<th><?php echo $this->Paginator->sort('stock_type'); ?></th>
			<th><?php echo $this->Paginator->sort('arrival_date'); ?></th>
			<th><?php echo $this->Paginator->sort('control_no'); ?></th>
			<th><?php echo $this->Paginator->sort('total_exp'); ?></th>
			<th><?php echo $this->Paginator->sort('buyer_company'); ?></th>
			<th><?php echo $this->Paginator->sort('buyer_contact'); ?></th>
			<th><?php echo $this->Paginator->sort('third_party'); ?></th>
			<th><?php echo $this->Paginator->sort('transport_date'); ?></th>
			<th><?php echo $this->Paginator->sort('transport_company'); ?></th>
			<th><?php echo $this->Paginator->sort('repair_company'); ?></th>
			<th><?php echo $this->Paginator->sort('repair_date'); ?></th>
			<th><?php echo $this->Paginator->sort('stock_id'); ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($purchases as $purchase): ?>
	<tr>
		<td><?php echo h($purchase['Purchase']['id']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['purchase_price1']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['purchase_price2']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['freight1']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['freight2']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['buying']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['ducamz_value']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['vendor_name']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['purchase_ref_no']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['purchase_by']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['pur_date']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['ship_date']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['ship_name']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['bl_no']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['cont_no']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['bol_1']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['stock_type']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['arrival_date']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['control_no']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['total_exp']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['buyer_company']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['buyer_contact']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['third_party']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['transport_date']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['transport_company']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['repair_company']); ?>&nbsp;</td>
		<td><?php echo h($purchase['Purchase']['repair_date']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($purchase['Stock']['chassis_no'], array('controller' => 'stocks', 'action' => 'view', $purchase['Stock']['id'])); ?>
		</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $purchase['Purchase']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $purchase['Purchase']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $purchase['Purchase']['id']), null, __('Are you sure you want to delete # %s?', $purchase['Purchase']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('New Purchase'), array('action' => 'add')); ?></li>
		<li><?php echo $this->Html->link(__('List Stocks'), array('controller' => 'stocks', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Stock'), array('controller' => 'stocks', 'action' => 'add')); ?> </li>
	</ul>
</div>
